<?php
// +----------------------------------------------------------------------
// | YFCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015-2016 http://www.rainfer.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: rainfer <81818832@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\controller;

use phpDocumentor\Reflection\DocBlock\Tag\VarTag;
use think\Db;
use app\admin\model\Page as NewsPage;

class Setting extends Base
{
    /**
     * 关于我们
     */
	public function about_add()
	{
	    $type = input("type");
	    $page_model = new NewsPage();
	    $detail = $page_model->where("type=$type")->find();
	    $this->assign('detail',$detail);
	    $this->assign("type",$type);
		return $this->fetch();
	}

    public function edit()
    {
       $data = array(
           'id'      =>input("id"),
           'keyword' =>input("news_key"),
           'content' =>input("news_content")
       );
      $rs = NewsPage::update($data);
        if($rs!==false){
            $this->success('操作成功,返回列表页',url('admin/Setting/about_add',array('type'=>input('type'))));
        }else{
            $this->error('操作失败',url('admin/Setting/about_add'));
        }

	}

}